using VigenereCipher.Models;

namespace VigenereCipher
{
    internal class Program
    {
        /// <summary>
        /// 维吉尼亚密码
        /// 输入两个文件，用散列函数检查文件内容是否相同
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //用户输入明文和密钥
            Console.Write($"请输入明文：");
            string plain = Console.ReadLine();
            Console.Write($"请输入密钥：");
            string key = Console.ReadLine();
            //加密
            MyEncoder myencoder = new MyEncoder();
            myencoder.PlainText = plain;
            myencoder.Key = key;
            myencoder.Encoder();
            //输出密文
            Console.WriteLine($"你的密文：{myencoder.CipherText}");
            //用户输入密文和密钥
            Console.Write($"请输入密文：");
            string cipher = Console.ReadLine();
            Console.Write($"请输入密钥：");
            string keytwo = Console.ReadLine();
            MyDecode mydecode = new MyDecode();
            mydecode.CipherText = cipher;
            mydecode.Key = keytwo;
            mydecode.Decode();
            //输出明文
            Console.WriteLine($"你的明文：{mydecode.PlainText});
            Console.ReadKey();
        }
    }
}